Skip to content

[DPE-9663] Support error propagation in TLS relation#29

Merged
reneradoi merged 19 commits intoconfig-for-certificate-extra-sansfrom
tls-relation-error-field
Mar 25, 2026
Merged

[DPE-9663] Support error propagation in TLS relation#29
reneradoi merged 19 commits intoconfig-for-certificate-extra-sansfrom
tls-relation-error-field

Conversation

@reneradoi
Copy link
Contributor

This PR adds support for error propagation from a TLS provider in accordance with TE202.

The operator observes the newly added certificate-denied event and displays a blocked status in case client TLS is enabled and the TLS provider is sending request_errors over the TLS relation interface.

The PR also adds integration test coverage with Vault as TLS provider.

Copy link

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks René, small comments on my side

csr.certificate_signing_request
for csr in self.client_certificate.get_csrs_from_requirer_relation_data()
]:
logger.error("Certificate request was denied: %s", event.error.message)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have 2 questions here:

  1. do we ever expect to receive from this hook a CSR we didn't create ourselves? if yes, how?
  2. if yes, we should also log when a CSR is not ours

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory we should not, but as we have the same safeguard in place for the certificate available event ... I've added some error logging for this case.

value=TEST_VALUE,
)
assert result == "OK", "Failed to write data without TLS"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an additional test where you remove the relation with Vault and the status goes away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - I found a nice improvement for the tls-relation-broken workflow on checking that.

Copy link
Contributor

@skourta skourta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @reneradoi

)

logger.info("Secret access will be granted now - wait for updated password")
juju.grant_secret(identifier=secret_name, app=APP_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to fix the flakiness we've been noticing on CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was investigating these tests locally and found that the update-status triggered by fast_forward can happen before the secret gets granted, and then the purpose of fast_forward gets defeated. So I moved it.

@reneradoi reneradoi merged commit b3cce13 into config-for-certificate-extra-sans Mar 25, 2026
7 of 8 checks passed
@reneradoi reneradoi deleted the tls-relation-error-field branch March 25, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants